package com.ctgu.tengyun.domain;

import com.ctgu.tengyun.exception.ConvertException;

public enum BooleanStatus implements HasDefaultInterface<BooleanStatus>{

    unknown(-1),
    false_flag(0),
    true_flag(1),
    ;

    private Integer value;

    BooleanStatus(Integer value) {
        this.value = value;
    }

    @Override
    public BooleanStatus getDefault() {
        return unknown;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static BooleanStatus valueOf(Integer value){
        for (BooleanStatus item: BooleanStatus.values()){
            if (item.getValue().equals(value)){
                return item;
            }
        }

        throw new ConvertException("unknown BooleanStatus. status:" + value);
    }

}